import { ComboBox, Item } from "@adobe/react-spectrum";
import { ListLocations } from "~/lib/server";



export function SelectLocation({ defaultSelectedKey = 0 }: { defaultSelectedKey?: number }) {


  const { data, error, isLoading } = ListLocations();


  return (



    <ComboBox
      name="locationId"
      label="位置"
      defaultItems={data}
      defaultSelectedKey={defaultSelectedKey}
      formValue="key"
    >
      {item => <Item>{item.name}</Item>}
    </ComboBox>

  );


}